package net.dengzixu.java.homework.period14.homework1;

/**
 * @author Deng Zixu <admin@dengzixu.com>
 */
public class FractionTest {
    public static void main(String[] args) {
        Fraction fraction1 = new Fraction(1, 2);
        Fraction fraction2 = new Fraction(1, 4);

        System.out.println("1/2 = " + fraction1.toDouble());
        System.out.println("1/4 = " + fraction2.toDouble());

        Fraction plusFraction = fraction1.plus(fraction2);
        System.out.println("1/2 x 1/4=" + plusFraction.toDouble());
        plusFraction.print();

        Fraction multiplyFraction = fraction1.multiply(fraction2);
        System.out.println("1/2 x 1/4=" + multiplyFraction.toDouble());
        multiplyFraction.print();
    }


}
